import Vue from "vue";
import VueRouter, { RouteConfig } from "vue-router";

Vue.use(VueRouter);

const routes: Array<RouteConfig> = [
  {
    path: "/",
    name: "Home",
    component: () => import("@/views/Home.vue"),
  },
  {
    path: "/addressList",
    name: "地址列表",
    component: () => import("@/views/AddressList.vue"),
  },
  {
    path: "/addressNew",
    name: "新增地址",
    component: () => import("@/views/AddressNew.vue"),
  },
  {
    path: "/addressEdit",
    name: "编辑地址",
    component: () => import("@/views/AddressEdit.vue"),
  },
  {
    path: "/detail",
    name: "订单详情",
    component: () => import("@/views/Detail.vue"),
  },
  {
    path: "/success",
    name: "付款成功",
    component: () => import("@/views/Success.vue"),
  },
  {
    path: "/info",
    name: "订单信息",
    component: () => import("@/views/Info.vue"),
  },
  // {
  //   path: "/about",
  //   name: "About",
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () =>
  //     import(/* webpackChunkName: "about" */ "../views/About.vue")
  // }
];

const router = new VueRouter({
  routes,
});

export default router;
